package com.legna.mhxy.support.controller;

import com.legna.mhxy.support.service.AnalysisService;
import com.legna.mhxy.support.utils.Result;
import com.legna.mhxy.support.vo.UserRingVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Tag(name="分析")
@RestController
@RequestMapping("/analysis")
@AllArgsConstructor
public class AnalysisController {

    private final AnalysisService analysisService;

    @GetMapping("/ring/{userId}")
    @Operation(summary = "分析 数量少的环")
    public Result<List<UserRingVO>> analysisLess(@PathVariable("userId")Long userId,
                                                 @RequestParam(value = "less",required = false,defaultValue = "4") Integer lessCount) {
        List<UserRingVO> less = analysisService.analysisLess(userId,lessCount);
        return Result.ok(less);
    }
}
